1 /*
2 
3 Boost Software License - Version 1.0 - August 17th, 2003
4 
5 Permission is hereby granted, free of charge, to any person or organization
6 obtaining a copy of the software and accompanying documentation covered by
7 this license (the "Software") to use, reproduce, display, distribute,
8 execute, and transmit the Software, and to prepare derivative works of the
9 Software, and to permit third-parties to whom the Software is furnished to
10 do so, all subject to the following:
11 
12 The copyright notices in the Software and this entire statement, including
13 the above license grant, this restriction and the following disclaimer,
14 must be included in all copies of the Software, in whole or in part, and
15 all derivative works of the Software, unless such copies or derivative
16 works are solely in the form of machine-executable object code generated by
17 a source language processor.
18 
19 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21 FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
22 SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
23 FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
24 ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
25 DEALINGS IN THE SOFTWARE.
26 
27 */ 
28 
29 module derelict.purple.notify;
30 
31 import derelict.glib.gtypes;
32 import derelict.glib.glibconfig;
33 import derelict.glib.glist;
34 import derelict.purple.connection;
35 
36 extern (C):
37 
38 alias _PurpleNotifyUserInfoEntry PurpleNotifyUserInfoEntry;
39 alias _PurpleNotifyUserInfo PurpleNotifyUserInfo;
40 alias void function (void*) PurpleNotifyCloseCallback;
41 alias _Anonymous_0 PurpleNotifyType;
42 alias _Anonymous_1 PurpleNotifyMsgType;
43 alias _Anonymous_2 PurpleNotifySearchButtonType;
44 alias _Anonymous_3 PurpleNotifySearchResults;
45 alias _Anonymous_4 PurpleNotifyUserInfoEntryType;
46 alias _Anonymous_5 PurpleNotifySearchColumn;
47 alias void function (_PurpleConnection*, _GList*, void*) PurpleNotifySearchResultsCallback;
48 alias _Anonymous_6 PurpleNotifySearchButton;
49 alias _Anonymous_7 PurpleNotifyUiOps;
50 
51 enum _Anonymous_0
52 {
53 	PURPLE_NOTIFY_MESSAGE = 0,
54 	PURPLE_NOTIFY_EMAIL = 1,
55 	PURPLE_NOTIFY_EMAILS = 2,
56 	PURPLE_NOTIFY_FORMATTED = 3,
57 	PURPLE_NOTIFY_SEARCHRESULTS = 4,
58 	PURPLE_NOTIFY_USERINFO = 5,
59 	PURPLE_NOTIFY_URI = 6
60 }
61 
62 enum _Anonymous_1
63 {
64 	PURPLE_NOTIFY_MSG_ERROR = 0,
65 	PURPLE_NOTIFY_MSG_WARNING = 1,
66 	PURPLE_NOTIFY_MSG_INFO = 2
67 }
68 
69 enum _Anonymous_2
70 {
71 	PURPLE_NOTIFY_BUTTON_LABELED = 0,
72 	PURPLE_NOTIFY_BUTTON_CONTINUE = 1,
73 	PURPLE_NOTIFY_BUTTON_ADD = 2,
74 	PURPLE_NOTIFY_BUTTON_INFO = 3,
75 	PURPLE_NOTIFY_BUTTON_IM = 4,
76 	PURPLE_NOTIFY_BUTTON_JOIN = 5,
77 	PURPLE_NOTIFY_BUTTON_INVITE = 6
78 }
79 
80 enum _Anonymous_4
81 {
82 	PURPLE_NOTIFY_USER_INFO_ENTRY_PAIR = 0,
83 	PURPLE_NOTIFY_USER_INFO_ENTRY_SECTION_BREAK = 1,
84 	PURPLE_NOTIFY_USER_INFO_ENTRY_SECTION_HEADER = 2
85 }
86 
87 struct _Anonymous_3
88 {
89 	GList* columns;
90 	GList* rows;
91 	GList* buttons;
92 }
93 
94 struct _Anonymous_5
95 {
96 	char* title;
97 }
98 
99 struct _Anonymous_6
100 {
101 	PurpleNotifySearchButtonType type;
102 	PurpleNotifySearchResultsCallback callback;
103 	char* label;
104 }
105 
106 struct _Anonymous_7
107 {
108 	void* function (PurpleNotifyMsgType, const(char)*, const(char)*, const(char)*) notify_message;
109 	void* function (PurpleConnection*, const(char)*, const(char)*, const(char)*, const(char)*) notify_email;
110 	void* function (PurpleConnection*, size_t, gboolean, const(char*)*, const(char*)*, const(char*)*, const(char*)*) notify_emails;
111 	void* function (const(char)*, const(char)*, const(char)*, const(char)*) notify_formatted;
112 	void* function (PurpleConnection*, const(char)*, const(char)*, const(char)*, PurpleNotifySearchResults*, gpointer) notify_searchresults;
113 	void function (PurpleConnection*, PurpleNotifySearchResults*, void*) notify_searchresults_new_rows;
114 	void* function (PurpleConnection*, const(char)*, PurpleNotifyUserInfo*) notify_userinfo;
115 	void* function (const(char)*) notify_uri;
116 	void function (PurpleNotifyType, void*) close_notify;
117 	void function () _purple_reserved1;
118 	void function () _purple_reserved2;
119 	void function () _purple_reserved3;
120 	void function () _purple_reserved4;
121 }
122 
123 struct _PurpleNotifyUserInfoEntry;
124 
125 
126 struct _PurpleNotifyUserInfo;
127 
128 
129 version(Derelict_Link_Static)
130 {
131     extern( C ) nothrow 
132     {
133 	    void* purple_notify_searchresults(PurpleConnection* gc, const(char)* title, const(char)* primary, const(char)* secondary, PurpleNotifySearchResults* results, PurpleNotifyCloseCallback cb, gpointer user_data);
134         void purple_notify_searchresults_free(PurpleNotifySearchResults* results);
135         void purple_notify_searchresults_new_rows(PurpleConnection* gc, PurpleNotifySearchResults* results, void* data);
136         void purple_notify_searchresults_button_add(PurpleNotifySearchResults* results, PurpleNotifySearchButtonType type, PurpleNotifySearchResultsCallback cb);
137         void purple_notify_searchresults_button_add_labeled(PurpleNotifySearchResults* results, const(char)* label, PurpleNotifySearchResultsCallback cb);
138         PurpleNotifySearchResults* purple_notify_searchresults_new();
139         PurpleNotifySearchColumn* purple_notify_searchresults_column_new(const(char)* title);
140         void purple_notify_searchresults_column_add(PurpleNotifySearchResults* results, PurpleNotifySearchColumn* column);
141         void purple_notify_searchresults_row_add(PurpleNotifySearchResults* results, GList* row);
142         guint purple_notify_searchresults_get_rows_count(PurpleNotifySearchResults* results);
143         guint purple_notify_searchresults_get_columns_count(PurpleNotifySearchResults* results);
144         GList* purple_notify_searchresults_row_get(PurpleNotifySearchResults* results, uint row_id);
145         char* purple_notify_searchresults_column_get_title(PurpleNotifySearchResults* results, uint column_id);
146         void* purple_notify_message(void* handle, PurpleNotifyMsgType type, const(char)* title, const(char)* primary, const(char)* secondary, PurpleNotifyCloseCallback cb, gpointer user_data);
147         void* purple_notify_email(void* handle, const(char)* subject, const(char)* from, const(char)* to, const(char)* url, PurpleNotifyCloseCallback cb, gpointer user_data);
148         void* purple_notify_emails(void* handle, size_t count, gboolean detailed, const(char*)* subjects, const(char*)* froms, const(char*)* tos, const(char*)* urls, PurpleNotifyCloseCallback cb, gpointer user_data);
149         void* purple_notify_formatted(void* handle, const(char)* title, const(char)* primary, const(char)* secondary, const(char)* text, PurpleNotifyCloseCallback cb, gpointer user_data);
150         void* purple_notify_userinfo(PurpleConnection* gc, const(char)* who, PurpleNotifyUserInfo* user_info, PurpleNotifyCloseCallback cb, gpointer user_data);
151         PurpleNotifyUserInfo* purple_notify_user_info_new();
152         void purple_notify_user_info_destroy(PurpleNotifyUserInfo* user_info);
153         GList* purple_notify_user_info_get_entries(PurpleNotifyUserInfo* user_info);
154         char* purple_notify_user_info_get_text_with_newline(PurpleNotifyUserInfo* user_info, const(char)* newline);
155         void purple_notify_user_info_add_pair(PurpleNotifyUserInfo* user_info, const(char)* label, const(char)* value);
156         void purple_notify_user_info_add_pair_plaintext(PurpleNotifyUserInfo* user_info, const(char)* label, const(char)* value);
157         void purple_notify_user_info_prepend_pair(PurpleNotifyUserInfo* user_info, const(char)* label, const(char)* value);
158         void purple_notify_user_info_remove_entry(PurpleNotifyUserInfo* user_info, PurpleNotifyUserInfoEntry* user_info_entry);
159         PurpleNotifyUserInfoEntry* purple_notify_user_info_entry_new(const(char)* label, const(char)* value);
160         void purple_notify_user_info_add_section_break(PurpleNotifyUserInfo* user_info);
161         void purple_notify_user_info_prepend_section_break(PurpleNotifyUserInfo* user_info);
162         void purple_notify_user_info_add_section_header(PurpleNotifyUserInfo* user_info, const(char)* label);
163         void purple_notify_user_info_prepend_section_header(PurpleNotifyUserInfo* user_info, const(char)* label);
164         void purple_notify_user_info_remove_last_item(PurpleNotifyUserInfo* user_info);
165         const(gchar)* purple_notify_user_info_entry_get_label(PurpleNotifyUserInfoEntry* user_info_entry);
166         void purple_notify_user_info_entry_set_label(PurpleNotifyUserInfoEntry* user_info_entry, const(char)* label);
167         const(gchar)* purple_notify_user_info_entry_get_value(PurpleNotifyUserInfoEntry* user_info_entry);
168         void purple_notify_user_info_entry_set_value(PurpleNotifyUserInfoEntry* user_info_entry, const(char)* value);
169         PurpleNotifyUserInfoEntryType purple_notify_user_info_entry_get_type(PurpleNotifyUserInfoEntry* user_info_entry);
170         void purple_notify_user_info_entry_set_type(PurpleNotifyUserInfoEntry* user_info_entry, PurpleNotifyUserInfoEntryType type);
171         void* purple_notify_uri(void* handle, const(char)* uri);
172         void purple_notify_close(PurpleNotifyType type, void* ui_handle);
173         void purple_notify_close_with_handle(void* handle);
174         void purple_notify_set_ui_ops(PurpleNotifyUiOps* ops);
175         PurpleNotifyUiOps* purple_notify_get_ui_ops();
176         void* purple_notify_get_handle();
177         void purple_notify_init();
178         void purple_notify_uninit();
179     }
180 }
181 else
182 {
183     extern( C ) nothrow 
184     {
185 	    alias da_purple_notify_searchresults = void* function(PurpleConnection* gc, const(char)* title, const(char)* primary, const(char)* secondary, PurpleNotifySearchResults* results, PurpleNotifyCloseCallback cb, gpointer user_data);			
186         alias da_purple_notify_searchresults_free = void function(PurpleNotifySearchResults* results);																																					
187         alias da_purple_notify_searchresults_new_rows = void function(PurpleConnection* gc, PurpleNotifySearchResults* results, void* data);																											
188         alias da_purple_notify_searchresults_button_add = void function(PurpleNotifySearchResults* results, PurpleNotifySearchButtonType type, PurpleNotifySearchResultsCallback cb);																	
189         alias da_purple_notify_searchresults_button_add_labeled = void function(PurpleNotifySearchResults* results, const(char)* label, PurpleNotifySearchResultsCallback cb);																			
190         alias da_purple_notify_searchresults_new = PurpleNotifySearchResults* function();																																								
191         alias da_purple_notify_searchresults_column_new = PurpleNotifySearchColumn* function(const(char)* title);																																		
192         alias da_purple_notify_searchresults_column_add = void function(PurpleNotifySearchResults* results, PurpleNotifySearchColumn* column);																											
193         alias da_purple_notify_searchresults_row_add = void function(PurpleNotifySearchResults* results, GList* row);																																	
194         alias da_purple_notify_searchresults_get_rows_count = guint function(PurpleNotifySearchResults* results);																																		
195         alias da_purple_notify_searchresults_get_columns_count = guint function(PurpleNotifySearchResults* results);																																	
196         alias da_purple_notify_searchresults_row_get = GList* function(PurpleNotifySearchResults* results, uint row_id);																																
197         alias da_purple_notify_searchresults_column_get_title = char* function(PurpleNotifySearchResults* results, uint column_id);																														
198         alias da_purple_notify_message = void* function(void* handle, PurpleNotifyMsgType type, const(char)* title, const(char)* primary, const(char)* secondary, PurpleNotifyCloseCallback cb, gpointer user_data);									
199         alias da_purple_notify_email = void* function(void* handle, const(char)* subject, const(char)* from, const(char)* to, const(char)* url, PurpleNotifyCloseCallback cb, gpointer user_data);														
200         alias da_purple_notify_emails = void* function(void* handle, size_t count, gboolean detailed, const(char*)* subjects, const(char*)* froms, const(char*)* tos, const(char*)* urls, PurpleNotifyCloseCallback cb, gpointer user_data);			
201         alias da_purple_notify_formatted = void* function(void* handle, const(char)* title, const(char)* primary, const(char)* secondary, const(char)* text, PurpleNotifyCloseCallback cb, gpointer user_data);											
202         alias da_purple_notify_userinfo = void* function(PurpleConnection* gc, const(char)* who, PurpleNotifyUserInfo* user_info, PurpleNotifyCloseCallback cb, gpointer user_data);																	
203         alias da_purple_notify_user_info_new = PurpleNotifyUserInfo* function();																																										
204         alias da_purple_notify_user_info_destroy = void function(PurpleNotifyUserInfo* user_info);																																						
205         alias da_purple_notify_user_info_get_entries = GList* function(PurpleNotifyUserInfo* user_info);																																				
206         alias da_purple_notify_user_info_get_text_with_newline = char* function(PurpleNotifyUserInfo* user_info, const(char)* newline);																													
207         alias da_purple_notify_user_info_add_pair = void function(PurpleNotifyUserInfo* user_info, const(char)* label, const(char)* value);																												
208         alias da_purple_notify_user_info_add_pair_plaintext = void function(PurpleNotifyUserInfo* user_info, const(char)* label, const(char)* value);																									
209         alias da_purple_notify_user_info_prepend_pair = void function(PurpleNotifyUserInfo* user_info, const(char)* label, const(char)* value);																											
210         alias da_purple_notify_user_info_remove_entry = void function(PurpleNotifyUserInfo* user_info, PurpleNotifyUserInfoEntry* user_info_entry);																										
211         alias da_purple_notify_user_info_entry_new = PurpleNotifyUserInfoEntry* function(const(char)* label, const(char)* value);																														
212         alias da_purple_notify_user_info_add_section_break = void function(PurpleNotifyUserInfo* user_info);																																			
213         alias da_purple_notify_user_info_prepend_section_break = void function(PurpleNotifyUserInfo* user_info);																																		
214         alias da_purple_notify_user_info_add_section_header = void function(PurpleNotifyUserInfo* user_info, const(char)* label);																														
215         alias da_purple_notify_user_info_prepend_section_header = void function(PurpleNotifyUserInfo* user_info, const(char)* label);																													
216         alias da_purple_notify_user_info_remove_last_item = void function(PurpleNotifyUserInfo* user_info);																																				
217         alias da_purple_notify_user_info_entry_get_label = const(gchar)* function(PurpleNotifyUserInfoEntry* user_info_entry);																															
218         alias da_purple_notify_user_info_entry_set_label = void function(PurpleNotifyUserInfoEntry* user_info_entry, const(char)* label);																												
219         alias da_purple_notify_user_info_entry_get_value = const(gchar)* function(PurpleNotifyUserInfoEntry* user_info_entry);																															
220         alias da_purple_notify_user_info_entry_set_value = void function(PurpleNotifyUserInfoEntry* user_info_entry, const(char)* value);																												
221         alias da_purple_notify_user_info_entry_get_type = PurpleNotifyUserInfoEntryType function(PurpleNotifyUserInfoEntry* user_info_entry);																											
222         alias da_purple_notify_user_info_entry_set_type = void function(PurpleNotifyUserInfoEntry* user_info_entry, PurpleNotifyUserInfoEntryType type);																								
223         alias da_purple_notify_uri = void* function(void* handle, const(char)* uri);																																									
224         alias da_purple_notify_close = void function(PurpleNotifyType type, void* ui_handle);																																							
225         alias da_purple_notify_close_with_handle = void function(void* handle);																																											
226         alias da_purple_notify_set_ui_ops = void function(PurpleNotifyUiOps* ops);																																										
227         alias da_purple_notify_get_ui_ops = PurpleNotifyUiOps* function();																																												
228         alias da_purple_notify_get_handle = void* function();																																															
229         alias da_purple_notify_init = void function();																																																	
230         alias da_purple_notify_uninit = void function();	
231     }
232 
233     __gshared
234     {
235 	    da_purple_notify_searchresults purple_notify_searchresults;
236 	    da_purple_notify_searchresults_free purple_notify_searchresults_free;
237 	    da_purple_notify_searchresults_new_rows purple_notify_searchresults_new_rows;
238 	    da_purple_notify_searchresults_button_add purple_notify_searchresults_button_add;
239 	    da_purple_notify_searchresults_button_add_labeled purple_notify_searchresults_button_add_labeled;
240 	    da_purple_notify_searchresults_new purple_notify_searchresults_new;
241 	    da_purple_notify_searchresults_column_new purple_notify_searchresults_column_new;
242 	    da_purple_notify_searchresults_column_add purple_notify_searchresults_column_add;
243 	    da_purple_notify_searchresults_row_add purple_notify_searchresults_row_add;
244 	    da_purple_notify_searchresults_get_rows_count purple_notify_searchresults_get_rows_count;
245 	    da_purple_notify_searchresults_get_columns_count purple_notify_searchresults_get_columns_count;
246 	    da_purple_notify_searchresults_row_get purple_notify_searchresults_row_get;
247 	    da_purple_notify_searchresults_column_get_title purple_notify_searchresults_column_get_title;
248 	    da_purple_notify_message purple_notify_message;
249 	    da_purple_notify_email purple_notify_email;
250 	    da_purple_notify_emails purple_notify_emails;
251 	    da_purple_notify_formatted purple_notify_formatted;
252 	    da_purple_notify_userinfo purple_notify_userinfo;
253 	    da_purple_notify_user_info_new purple_notify_user_info_new;
254 	    da_purple_notify_user_info_destroy purple_notify_user_info_destroy;
255 	    da_purple_notify_user_info_get_entries purple_notify_user_info_get_entries;
256 	    da_purple_notify_user_info_get_text_with_newline purple_notify_user_info_get_text_with_newline;
257 	    da_purple_notify_user_info_add_pair purple_notify_user_info_add_pair;
258 	    da_purple_notify_user_info_add_pair_plaintext purple_notify_user_info_add_pair_plaintext;
259 	    da_purple_notify_user_info_prepend_pair purple_notify_user_info_prepend_pair;
260 	    da_purple_notify_user_info_remove_entry purple_notify_user_info_remove_entry;
261 	    da_purple_notify_user_info_entry_new purple_notify_user_info_entry_new;
262 	    da_purple_notify_user_info_add_section_break purple_notify_user_info_add_section_break;
263 	    da_purple_notify_user_info_prepend_section_break purple_notify_user_info_prepend_section_break;
264 	    da_purple_notify_user_info_add_section_header purple_notify_user_info_add_section_header;
265 	    da_purple_notify_user_info_prepend_section_header purple_notify_user_info_prepend_section_header;
266 	    da_purple_notify_user_info_remove_last_item purple_notify_user_info_remove_last_item;
267 	    da_purple_notify_user_info_entry_get_label purple_notify_user_info_entry_get_label;
268 	    da_purple_notify_user_info_entry_set_label purple_notify_user_info_entry_set_label;
269 	    da_purple_notify_user_info_entry_get_value purple_notify_user_info_entry_get_value;
270 	    da_purple_notify_user_info_entry_set_value purple_notify_user_info_entry_set_value;
271 	    da_purple_notify_user_info_entry_get_type purple_notify_user_info_entry_get_type;
272 	    da_purple_notify_user_info_entry_set_type purple_notify_user_info_entry_set_type;
273 	    da_purple_notify_uri purple_notify_uri;
274 	    da_purple_notify_close purple_notify_close;
275 	    da_purple_notify_close_with_handle purple_notify_close_with_handle;
276 	    da_purple_notify_set_ui_ops purple_notify_set_ui_ops;
277 	    da_purple_notify_get_ui_ops purple_notify_get_ui_ops;
278 	    da_purple_notify_get_handle purple_notify_get_handle;
279 	    da_purple_notify_init purple_notify_init;
280 	    da_purple_notify_uninit purple_notify_uninit;
281     }
282 }